//============================================================================
// Name        : MutualInformation.cpp
// Author      : Erman Gurses
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <cv.h>
#include <opencv2/core/core.hpp>
#include <highgui.h>
#include <iostream>
#include <opencv2/gpu/gpu.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
Mat rotate(Mat src, double angle)
{
    Mat dst;
    Point2f pt(src.cols/2, src.rows/2);
    Mat r = getRotationMatrix2D(pt, angle, 1.0);
    warpAffine(src, dst, r, Size(src.cols, src.rows),WARP_INVERSE_MAP);
    return dst;
}
int main( int argc, char** argv )
{

 Mat  imageGray,imageRGB, padded, cc;


 imageGray= imread("/home/erman/cuda-workspace/ROI/src/imageGray.bmp", CV_LOAD_IMAGE_GRAYSCALE);
 imageRGB  = imread("/home/erman/cuda-workspace/ROI/src/imageRGB.bmp", CV_LOAD_IMAGE_GRAYSCALE);

 int padding  = 100;



 padded.create(imageGray.rows + 3*padding, imageGray.cols + 3*padding , imageGray.type());
 padded.setTo(cv::Scalar::all(0));

 Mat imageRGBR;

 imageRGBR = rotate(imageRGB, -30);

 imageGray.copyTo(padded(Rect(padding, padding, imageGray.cols, imageGray.rows)));
 imageRGBR.copyTo(padded(Rect(2 * padding, 2 * padding, imageGray.cols, imageGray.rows)));


 imshow("Example1",padded);
  waitKey(0);




  return 0;


}
